<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
class TownLocale{

    const  All_Others = 'All Others';

    // Kent DE
    const  Dover = 'Dover';
    const  Farmington = 'Farmington';
    const  Felton = 'Felton';
    const  Hartly = 'Hartly';
    const  Kenton = 'Kenton';
    const  Little_Creek = 'Little Creek';
    const  Milford = 'Milford';
    const  Woodside = 'Woodside';

    // New Castle DE
    const  Arden = 'Arden';
    const  Ardencroft = 'Ardencroft';
    const  Ardentown = 'Ardentown';
    const  Bellefonte = 'Bellefonte';
    const  Delaware_City = 'Delaware City';
    const  Middleton = 'Middleton';
    const  New_Castle_City = 'New Castle City';
    const  Newark = 'Newark';

    // Sussex DE
    const  Delmar = 'Delmar';
    const  Ellendale = 'Ellendale';
    const  Georgetown = 'Georgetown';
    const  Greenwood = 'Greenwood';
    const  Laurel = 'Laurel';
    const  Lincoln = 'Lincoln';
    const  Prime_Hook_Beach = 'Prime Hook Beach';
    const  Seaford = 'Seaford';

    private $name;

    /**
     * This is used to support GWT serialization, do not use this constructor for other purposes.
     */

    public function TownLocale($name) {
        $this->name = $name;
    }

    public function getName() {
        return $this->name;
    }

//    public static ITownLocale valueOf(String name) {
//        for (EState state : EState.getAllStates()) {
//            for (ICountyLocale countyLocale : CountyLocale.getCountyLocales(state)) {
//                for (ITownLocale locale : getTownLocales(state, countyLocale)) {
//                    if (locale.getName().equals(name)) {
//                        return locale;
//                    }
//                }
//            }
//        }
//
//        throw new IllegalArgumentException("Town name is not recognized " + name);
//    }

//    public static List<ITownLocale> getTownLocales(EState state, ICountyLocale countyLocale) {
//        final List<ITownLocale> townLocales = new ArrayList<ITownLocale>();
//
//        if (state == EState.DE) {
//            if (countyLocale.equals(CountyLocale.Sussex)) {
//                townLocales.add(Delmar);
//                townLocales.add(Ellendale);
//                townLocales.add(Georgetown);
//                townLocales.add(Greenwood);
//                townLocales.add(Laurel);
//                townLocales.add(Lincoln);
//                townLocales.add(Milford);
//                townLocales.add(Prime_Hook_Beach);
//                townLocales.add(Seaford);
//            } else if (countyLocale.equals(CountyLocale.New_Castle)) {
//                townLocales.add(Arden);
//                townLocales.add(Ardencroft);
//                townLocales.add(Ardentown);
//                townLocales.add(Bellefonte);
//                townLocales.add(Delaware_City);
//                townLocales.add(Middleton);
//                townLocales.add(New_Castle_City);
//                townLocales.add(Newark);
//            } else if (countyLocale.equals(CountyLocale.Kent)) {
//                townLocales.add(Dover);
//                townLocales.add(Farmington);
//                townLocales.add(Felton);
//                townLocales.add(Hartly);
//                townLocales.add(Kenton);
//                townLocales.add(Little_Creek);
//                townLocales.add(Milford);
//                townLocales.add(Woodside);
//            }
//            townLocales.add(All_Others);
//        }
//
//        return townLocales;
//    }

    
    public function equals($o) {
        
        if ($this->name == $o) return true;

        return false;
    }
}
?>
